#ifndef CX_CONTROL_H
#define CX_CONTROL_H
#include "cx_typedef.h"

#define CX_CONTROL_ENABLE_PID
typedef struct cx_pid_control_param cx_pid_control_param_t;
typedef struct cx_pid_control_object cx_pid_control_object_t;
typedef float (*cx_pid_handler_t) (cx_uint dt, cx_pid_control_object_t *param);


struct cx_pid_control_param
{
    struct cx_pid_control_object *next_pid_object;
    float target;
    float input;
    float pre_input;
    float pre_output;
    float kp;
    float ki;
    float integral_value;
    float max_integral_value;
    float kd;
};

struct cx_pid_control_object
{
    cx_pid_control_param_t param;
    cx_pid_handler_t handler;
};


#ifdef CX_CONTROL_ENABLE_PID

#endif

#endif